<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view(TPL_FOLDER."header");?>
<script type="text/javascript" src="{root_path}js/My97DatePicker/WdatePicker.js" charset="gb2312"></script>
<table width="100%" border="0" cellpadding="5" cellspacing="0" >
  <tr>
    <td width="3%" align="left" ><img src="{tpl_path}images/forward.jpg" /></td>
    <td width="97%" align="left" >您现在的位置：<a href="<?php echo site_url(CTL_FOLDER."guestbook");?>">全部留言</a> </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-bottom:solid 1px #3C4952; margin-bottom:5px; margin-top:5px">
  <tr>
    <td width="552" height="24" align="left" ><form method="get">
        <input type="text" name="s_keyword" id="s_keyword" size="15">
        &nbsp;从
        <input type="text" name="s_date" id="s_date" size="15" onClick="WdatePicker({'dateFmt':'yyyy-MM-dd HH:mm:ss'})">
        &nbsp;到
        <input type="text" name="e_date" id="e_date" size="15" onClick="WdatePicker({'dateFmt':'yyyy-MM-dd HH:mm:ss'})">
        &nbsp;
        <input type="submit" name="s_sb" value="搜索" class="button-style2">
      </form></td>
    <td width="191" align="right" ><a href="<?php echo site_url(CTL_FOLDER."guestbook/");?>?is_pass=1">已审核(<font style="color:#FF0000"><?php echo $is_pass_num['pass_num'];?></font>)</a> | <a href="<?php echo site_url(CTL_FOLDER."guestbook/");?>?is_pass=0">未审核(<font style="color:#FF0000"><?php echo $is_pass_num['not_pass_num'];?></font>)</a></td>
  </tr>
</table>
<form method="post" name="list_form" id="list_form">
  <table width="100%" cellspacing="0" class="widefat">
    <thead>
      <tr>
        <th width="5%"><input type="checkbox" onclick="check_box(this.form.rd_id)" /></th>
        <th width="18%">客户名称</th>
        <th width="15%">E-mail</th>
        <th width="17%">联系方式</th>
        <th width="16%">留言日期</th>
        <th width="21%">审核状态</th>
        <th width="8%">操作</th>
      </tr>
    </thead>
    <tfoot>
    </tfoot>
    <tbody id="check_box_id">
      <?php foreach($query->result() as $row) {?>
      <tr>
        <td><input name="rd_id[]" type="checkbox" id="rd_id" value="<?php echo $row->id;?>"></td>
        <td><?php echo $row->user_name;?></td>
        <td><?php echo $row->email;?></td>
        <td><?php echo $row->tel;?></td>
        <td><?php echo date("Y-m-d",$row->create_date);?></td>
        <td><?php 
		if($row->is_pass)
		{
		?>
          <img src="{tpl_path}images/yes.gif" onclick="ajax_toggle(this,<?php echo $row->id;?>,'<?php echo site_url(CTL_FOLDER."guestbook/ajax_toggle");?>')" style="cursor:pointer" />
          <?php
		}
		else
		{
		?>
          <img src="{tpl_path}images/no.gif" onclick="ajax_toggle(this,<?php echo $row->id;?>,'<?php echo site_url(CTL_FOLDER."guestbook/ajax_toggle");?>')" style="cursor:pointer" />
          <?php
		}
		?>        </td>
        <td><a href="<?php echo site_url(CTL_FOLDER."guestbook/edit_record/".$row->id);?>?url=<?php echo get_curren_url();?>">回复</a></td>
      </tr>
      <?php }?>
    </tbody>
  </table>
  <table width="100%" border="0" cellspacing="0" cellpadding="0" >
    <tr>
      <td style="padding-top:5px"><select name="action_url" id="action_url">
          <option value="" style="color:#FF0000">-选择操作-</option>
          <option value="<?php echo site_url(CTL_FOLDER."guestbook/del_record");?>">删除</option>
          <option value="<?php echo site_url(CTL_FOLDER."guestbook/pass");?>">审核通过</option>
        </select>
        &nbsp;
        <input type="button" name="submit_list_button" class="button-style2" onclick="submit_list_form(this.form,this)" id="submit_list_button" value="执行操作" />  <img src="{tpl_path}images/notice.gif" class="tooltips" title="操作步骤：在左边勾选要操作的记录-->选择需要执行的操作-->点击“执行操作”按钮-->完成。注：只有审核通过才能在前台显示" />
      </td>
      <td align="right"><?php echo $paginate;?></td>
    </tr>
  </table>
</form>
<?php $this->load->view(TPL_FOLDER."footer");?>
